<% 
	var background_color = board.attributes.background_color; 
    var background_picture_url = board.attributes.background_picture_url; 
    var background_pattern_url = board.attributes.background_pattern_url; 
    var preview = ''; 
    if (!_.isEmpty(background_picture_url) && background_picture_url != 'NULL') { 
		background_picture_url = background_picture_url.replace("_XXXX.jpg", "_b.jpg");
    	preview = '<span style="background-image:url(' + background_picture_url + ');" class="background-box show well-lg"></span>'; 
     } else if (!_.isEmpty(background_pattern_url) && background_pattern_url != 'NULL') { 
		background_pattern_url = background_pattern_url.replace("_XXXX.jpg", "_s.jpg");
     	preview = '<span style="background-image:url(' + background_pattern_url + ');" class="background-box show well-lg"></span>'; 
     } else if (!_.isEmpty(background_color) && background_color != 'NULL') { 
     	preview = '<span style="background-color:' + background_color + '" class=" background-box show well-lg"></span>'; 
     }
%>
<!-- <li class="js-sync-google-dropdown inner-dropdown js-invite-users"><a data-toggle="dropdown" href="#" class="js-invite-users"><span class="icon-sm icon-user icon-type"></span> <%- i18next.t('Invite') %></a></li>  -->
<li class="js-list-form"><a class="nav-list-item js-show-filters" href="#"><span class="icon-sm icon-filter icon-type"></span> <%- i18next.t('Filter Cards') %></a></li>
<% if(!_.isUndefined(authuser.user)) { %>
	<% if(!_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "delete_labels",board_user_role_id: parseInt(board.board_user_role_id)})))) { %>
	<li><a class="nav-list-item js-show-labels" href="#"><span class="icon-sm  icon-tag icon-type"></span> <%- i18next.t('Labels') %></a></li>
	<% } %>
<% } %>
<% if(!_.isUndefined(authuser.user)) {%>
	<% if(authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "view_archived_lists",board_user_role_id: parseInt(board.board_user_role_id)})) || !_.isEmpty(board.acl_links.where({slug: "view_archived_cards",board_user_role_id: parseInt(board.board_user_role_id)}))) { %>
	<li><a class="nav-list-item js-archived-items" href="#"><span class="icon-sm icon-archive icon-type"></span> <%- i18next.t('Archived Items') %></a></li>
	<% } %>
<% } %> 
<%if(!_.isUndefined(authuser.user)) {%>
<% if(authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "view_sync_calendar",board_user_role_id: parseInt(board.board_user_role_id)}))) { %>
<li class="dropdown js-sync-google-dropdown inner-dropdown"><a href="#" class="js-syn-google-calendar" data-toggle="dropdown"><span class="icon-calendar"></span> <%- i18next.t('iCal Feed') %></a></li>
<% } %>
<li class="divider"></li>
<%if(!_.isUndefined(authuser.user)) {%> 
  <li class="navbar-btn right-mar">
	<form name="BoardSubscribeForm" id="BoardSubscribeForm">
	  <input id="inputBoardSubscribe" name="is_subscribed" type="hidden" value=" <% if(!_.isUndefined(subscriber)) { %> <%- subscriber.attributes.is_subscribed %><%}else{%>0<%}%>">
	</form> 
	<% if(!_.isUndefined(subscriber) && parseInt(subscriber.attributes.is_subscribed)) { %>
	<% if(!_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || ((!_.isEmpty(board.acl_links.where({slug: "board_subscriber",board_user_role_id: parseInt(board.board_user_role_id)}))) || (!_.isEmpty(role_links.where({slug: "unsubscribe_board"})) && board.attributes.board_visibility == 2)))) { %>
	<a href="#" class="js-show-unsubscribe-form navbar-btn h4 list-group-item-text" name="unsubscribe" title="<%- i18next.t('Subscribed') %>"><i class="icon-eye-close"></i><span><%- i18next.t('Subscribed') %> <i class="icon-ok js-filter-icon cur"></i></span></a>
	<% } %>
	<% } else {%> 
	<% if(!_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || ((!_.isEmpty(board.acl_links.where({slug: "subscribe_board",board_user_role_id: parseInt(board.board_user_role_id)})))  || (!_.isEmpty(role_links.where({slug: "subscribe_board"})) && board.attributes.board_visibility == 2)))){ %>
	<a href="#" class="js-show-subscribe-form navbar-btn h4" name="subscribe" title="<%- i18next.t('Subscribe') %>"><i class="icon-eye-open"></i><span><%- i18next.t('Subscribe') %></span></a>
	<% } %>
	<% } %>
	</li>
	<% if (!_.isUndefined(APPS) && APPS !== null && !_.isUndefined(APPS.enabled_apps) && APPS.enabled_apps !== null && (($.inArray('r_gridview_configure',APPS.enabled_apps) !== -1 && (!_.isEmpty(role_links.where({slug: "r_gridview_configure"})))) || ($.inArray('r_listview_configure',APPS.enabled_apps) !== -1 && (!_.isEmpty(role_links.where({slug: "r_listview_configure"}))))) && !_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "edit_board",board_user_role_id: parseInt(board.board_user_role_id)})))) {%>
	<li><a href="#" class="nav-list-item nav-list-sub-item js-choose-columns"> <%- i18next.t('Choose Columns...') %></a></li>
	<% } %>  	
	<li class="js-background-change"></li>
<% } %>  
<% if(!_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "edit_board",board_user_role_id: parseInt(board.board_user_role_id)})))) {%>
<li><a href="#" class="nav-list-item nav-list-sub-item js-change-background"><%- i18next.t('Change Background') %></a></li>
<% if(!_.isEmpty(IMAP_EMAIL)){ %>
<li><a href="#" class="nav-list-item nav-list-sub-item js-email-to-board-settings"> <%- i18next.t('Email to board settings') %></a></li>
<% } %>
<% } %>
<% if(!_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "copy_board",board_user_role_id: parseInt(board.board_user_role_id)})))) {%>
	<li class="js-sync-google-dropdown inner-dropdown"><a data-toggle="dropdown" href="#" class="js-show-copy-board"><%- i18next.t('Copy Board') %></a></li>
<% }%>
<% } %>
<li class="divider"></li>
<li class="js-chat-history-enable"><a href="#" class="js-show-board-modal" data-toggle="modal" data-target="#modalListView"><%- i18next.t('Show Attachments') %></a></li>
<% if(!_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "edit_board",board_user_role_id: parseInt(board.board_user_role_id)})))) {%>
<li><a href="#" class="js-additional-settings"><%- i18next.t('Additional Settings') %></a></li>
<% if(!board.attributes.is_closed) {%>
<li class="divider"></li>
<li class="dropdown js-open-dropdown dropup"><a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-sm icon-warning-sign icon-type text-primary"></i><%- i18next.t('Close Board') %></a>
  <ul class="dropdown-menu dropdown-menu-left dropup-arrow">
	<li class="js-dropdown-popup dropdown-popup">
	  <div class="clearfix text-center col-xs-12">
		<span class="col-xs-10"><strong><%- i18next.t('Close Board') %></strong></span><a class="js-close-sub-popover pull-right" href="#"><i class="icon-remove"></i></a>						
	  </div>
	  <div class="col-xs-12 divider"></div>
	  <div class="col-xs-12">
		<form class="normal" name="BoardCloseForm" id="BoardCloseForm">
		  <input id="inputBoardClose" name="is_closed" type="hidden" value="true">
		  <p><%- i18next.t('You can reopen the board by clicking the "Boards" menu from the header, selecting "View Closed Boards", finding the board and clicking "Reopen".') %></p>
		  <div class="submit">
			<input type="submit" value="<%- i18next.t('Close') %>" id="submitBoardClose" class="btn btn-primary js-close-board">
		  </div>
		</form>
	  </div>
	</li>
  </ul>
</li>
<% } %>
<% } %>